Package com.apps.test

Source Code of com.apps.test.UBCCourseSpiderDatastoreTest

/*
* @author Cole Gehlen
*/


package com.apps.test;

import static org.junit.Assert.*;

import org.junit.Test;

import com.apps.datastore.*;
import com.apps.datastore.dao.BookInformationObject;
import com.apps.datastore.dao.CourseInformationObject;
import com.apps.datastore.dao.DepartmentInformationObject;
import com.apps.datastore.dao.SectionInformationObject;
import com.apps.services.UBCCourseSpiderService;


public class UBCCourseSpiderDatastoreTest {

  @Test
  public void test() { 
   
   
   
    UBCCourseSpiderDatastore usd = new UBCCourseSpiderDatastore();
    usd.initSchema();
    UBCCourseSpiderService ucs = new UBCCourseSpiderService();
   
    for(DepartmentInformationObject i : ucs.getDepartments()){
      usd.addDepartment(i);
    }
   
    for(CourseInformationObject i : ucs.getCourses(usd.getDepartmentList().get(5))){
      usd.addCourse(i);
    }
   
    for(SectionInformationObject i : ucs.getSections(usd.getCourseList().get(0))){
      usd.addSection(i);
    }
   
    for(BookInformationObject i : ucs.getBooks(usd.getSectionList().get(0))){
      usd.addBooks(i);
    }
   
   
    System.out.println(usd.getDepartmentList().get(0).getDepartmentId());
    System.out.println(usd.getCourseList().get(0).getCourseTitle());
    System.out.println(usd.getSectionList().get(0).getSectionId());
    System.out.println(usd.getBookList(usd.getSectionList().get(0)).get(0).getTitle());
 
    assertTrue(usd.getDepartmentList().get(0).getDepartmentId().equals(""));
    assertTrue(usd.getCourseList().get(0).getCourseTitle().equals(""));
    assertTrue(usd.getSectionList().get(0).getSectionId().equals(""));
    assertTrue(usd.getBookList(usd.getSectionList().get(0)).get(0).getTitle().equals(""));
 
   
  }

}
TOP

Related Classes of com.apps.test.UBCCourseSpiderDatastoreTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.